# 车牌区域划分, 现给出以下车牌. 根据车牌的信息, 分析出各省的车牌持有量.
cars = ['鲁A32444', '鲁B12333', '京B8989M', '黑C49678', '黑C46555', '沪B25041', '黑C34567']
locations = {'沪': '上海', '京': '北京', '黑': '黑龙江', '鲁': '山东', '鄂': '湖北', '湘': '湖南'}

# 结果:
# {"上海":1, "北京":1, "黑龙江":3, "山东":2}

city = {}
for key ,val in locations.items():
    count = 0
    for car in cars:
        if car.count(key):
            count  += car.count(key)
            city[val] = count
print(city)


